function Q(a) {
	if (!a) {
		return null
	}
	if (a.constructor == String) {
		var b = document.querySelectorAll(a);
		return b
	}
	return a
}
Q.trim = function(b) {
	var a = new RegExp("(^[\\s\\t\\xa0\\u3000]+)|([\\u3000\\xa0\\s\\t]+$)", "g");
	return String(b).replace(a, "")
};
Q.addClass = function(h, j) {
	h = Q(h);
	var b = j.split(/\s+/), a = h.className, f = " " + a + " ", g = 0, d = b.length;
	for (; g < d; g++) {
		if (f.indexOf(" " + b[g] + " ") < 0) {
			a += ( a ? " " : "") + b[g]
		}
	}
	h.className = Q.trim(a);
	return h
};
Q.hasClass = function(d, f) {
	d = Q(d);
	if (!d.nodeType === 1) {
		return false
	}
	var b = Q.trim(f).split(/\s+/), a = b.length;
	className = d.className.split(/\s+/).join(" ");
	while (a--) {
		if (!(new RegExp("(^| )" + b[a] + "( |$)")).test(className)) {
			return false
		}
	}
	return true
};
Q.removeClass = function(f, h) {
	f = Q(f);
	var b = f.className.split(/\s+/);
	var g = h.split(/\s+/);
	var a = b.length;
	var j = g.length;
	for (var d = 0; d < j; d++) {
		while (a--) {
			if (b[a] == g[d]) {
				b.splice(a, 1);
				break
			}
		}
	}
	f.className = b.join(" ");
	return f
};
Q.tap = function(f, k) {
	var a, h, d, g, b, j;
	a = "1.0.1";
	d = 2 * 1000;
	j = function(l, m) {
		return function() {
			return l.apply(m, arguments)
		}
	};
	if ("ontouchstart" in document.documentElement) {
		f.addEventListener("touchstart", j(function(l) {
			g = new Date().getTime();
			h = false
		}, f));
		f.addEventListener("touchmove", j(function(l) {
			h = true
		}, f));
		f.addEventListener("touchend", j(function(l) {
			b = new Date().getTime();
			if (!h && ((b - g) < d)) {
				k(l)
			}
		}, f));
		f.addEventListener("touchcancel", j(function(l) {
			k(l)
		}, f))
	} else {
		f.addEventListener("click", j(function(l) {
			k(l)
		}, f))
	}
};
Q.parent = function(b, a) {
	a = a ? a : function() {
		return true
	};
	while (( b = b.parentNode) && b.nodeType == 1) {
		if (a(b)) {
			return b
		}
	}
	return null
};
Q.getData = function(a, b) {
	if (window.nativeStorage) {
		return window.nativeStorage.get(a)
	} else {
		if (window.localStorage) {
			return window.localStorage[a]
		} else {
			return Q.getCookie(a)
		}
	}
};
Q.setData = function(a, b) {
	if (window.nativeStorage) {
		return window.nativeStorage.set(a, b)
	} else {
		if (window.localStorage) {
			window.localStorage[a] = b
		} else {
			Q.setCookie(a, b, {
				expires : new Date("2020-12-23")
			})
		}
	}
};
Q.remove = function() {
	var f;
	for (var a = 0, d = arguments.length; a < d; a++) {
		f = Q(arguments[a]);
		try {
			f.parentNode.removeChild(f)
		} catch(b) {
		}
	}
};
Q.loadJs = function(d) {
	d.id = d.id || "LoadedJs" + new Date().getTime();
	d.isRemove = d.isRemove || true;
	var b = document.createElement("script");
	b.id = d.id;
	b.type = "text/javascript";
	b.charset = d.charset || "gb2312";
	var f = function() {
		d.callback && d.callback();
		if (d.isRemove) {
			Q.remove("#" + d.id)
		}
	};
	if (b.readyState) {
		b.onreadystatechange = function() {
			if (b.readyState == "loaded" || b.readyState == "complete") {
				b.onreadystatechange = null;
				f()
			}
		}
	} else {
		b.onload = function() {
			f()
		}
	}
	b.src = d.src;
	var a = document.getElementsByTagName("script")[0];
	a.parentNode.insertBefore(b, a)
};
Q.remoteSetData = function(a, b, d) {
	Q.loadJs({
		src : "http://fread.qq.com/redisTool?type=set&key=" + encodeURIComponent(a) + "&value=" + encodeURIComponent(b),
		charset : "utf-8",
		callback : function() {
			if ( typeof redisData != "undefined" && d) {
				d(redisData)
			}
		}
	})
};
Q.remoteGetData = function(a, b) {
	Q.loadJs({
		src : "http://fread.qq.com/redisTool?type=get&key=" + encodeURIComponent(a),
		charset : "utf-8",
		callback : function() {
			if ( typeof redisData != "undefined" && b) {
				b(redisData)
			}
		}
	})
};
Q.getQuery = function(b, d) {
	var f = new RegExp("(^|&|\\?|#)" + d + "=([^&#]*)(&|$|#)", "");
	var a = b.match(f);
	if (a) {
		return a[2]
	}
	return ""
};
Q.debug = function(b) {
	var a = Q("#DebugContainer");
	if (!a) {
		a = document.createElement("div");
		a.id = "DebugContainer";
		document.body.appendChild(a)
	}
	if (a) {
		a.innerHTML += b + "<br>";
		if (console && console.log) {
			console.log(b)
		}
	}
};
Q.delQueryValue = function(a, k) {
	if (!Q.getQuery(a, k)) {
		return a
	}
	var j = a.indexOf("?");
	var h = a.substr(0, a.indexOf("?"));
	var d = a.substr(a.indexOf("?") + 1);
	var g = d.split("&");
	for (var f = 0, b = g.length; f < b; f++) {
		var l = g[f].split("=")[0];
		if (l == k) {
			g.splice(f, 1);
			break
		}
	}
	if (g.length == 0) {
		return h
	} else {
		return h + "?" + g.join("&")
	}
};
var openAppController = function(h) {
	function g(j) {
		var k = new RegExp("(^|&)" + j + "=([^&]*)(&|$)");
		var l = h.location.search.substr(1).match(k);
		if (null != l) {
			return unescape(l[2])
		}
		return null
	}

	function b(l) {
		var k = "";
		if (l) {
			for (var j = 0; j < l.length; j++) {
				c = l.charAt(j);
				if ("<" == c || ">" == c) {
					continue
				}
				k += c
			}
		}
		return k
	}
	f.today = new Date();
	f.seed = f.today.getTime();
	function f() {
		f.seed = (f.seed * 9301 + 49297) % 233280;
		return f.seed / (233280)
	}

	function a(j) {
		return Math.ceil(f() * j)
	}

	function d() {
		key = a(100000000) + "";
		sum = 0;
		for (var j = 0; j < key.length; j++) {
			sum += parseInt(key[j])
		}
		sum += "";
		return key.length + key + sum.length + sum
	}
	return {
		isInstallNews : undefined,
		isInstallLive : undefined,
		isInstallWeishi : undefined,
		isIpad : false,
		showDone : false,
		newsDownloadState : 1,
		videoDownloadState : 1,
		newsVersion : 0,
		contentW : 320,
		initStart : function() {
			if ( typeof WeixinJSBridge != "undefined" && WeixinJSBridge.invoke) {
				openAppController.init()
			} else {
				document.addEventListener("WeixinJSBridgeReady", openAppController.init)
			}
			openAppController.adjustBtnWidth();
			openAppController.reformTime();
			openAppController.reformComment();
			openAppController.reCheck();
			openAppController.sendBoss("pageView")
		},
		adjustBtnWidth : function() {
			var l = document.body.clientWidth;
			var o = document.getElementById("content");
			var j = h.getComputedStyle(o, null);
			var k = l - parseInt(j["margin-left"]) - parseInt(j["margin-right"]);
			k = k < 720 && k > 0 ? k : 280;
			openAppController.contentW = k;
			var m = document.querySelector("#imgdownload");
			if (m) {
				m.style.width = k + "px"
			}
		},
		addBossParam : function(l) {
			if (l && l.href) {
				var k = l.href;
				var j = "reqkey=" + d() + "&mmuin=" + b(g("mmuin")) + "&openid=" + Q.getQuery(document.location.href, "openid");
				l.href = k.indexOf("?") > -1 ? k + "&" + j : k + "?" + j
			}
		},
		reCheck : function() {
			setTimeout(function() {
				openAppController.showModuleDownload();
				openAppController.showModuleDownloadVideo()
			}, 6000)
		},
		init : function() {
			openAppController.checkIsInstall()
		},
		checkIsInstall : function() {
			var l = navigator.userAgent.toLowerCase();
			var k = /iphone/i.test(l) ? true : false;
			var j = /android/i.test(l) ? true : false;
			if (!j && WeixinJSBridge.env) {
				openAppController.isIpad = WeixinJSBridge.env("model").toLowerCase().indexOf("ipad") > -1 ? true : false
			}
			if (!j) {
				if (openAppController.isIpad) {
					openAppController.hasApp("com.tencent.news", "qqnewshd://can_open_me_if_install_and_regeister_this_scheme", 0)
				} else {
					openAppController.hasApp("com.tencent.news", "qqnews://can_open_me_if_install_and_regeister_this_scheme", 0);
					openAppController.hasApp("com.tencent.qqlive", "tenvideo2://can_open_me_if_install_and_regeister_this_scheme", 0);
					openAppController.hasApp("com.tencent.weishi", "weishiiosscheme://can_open_me_if_install_and_regeister_this_scheme", 0)
				}
			} else {
				openAppController.hasApp("com.tencent.news", "qqnews://can_open_me_if_install_and_regeister_this_scheme", 220);
				openAppController.hasApp("com.tencent.qqlive", "tenvideo2://can_open_me_if_install_and_regeister_this_scheme", 0);
				openAppController.hasApp("com.tencent.microvision", "weishiiosscheme://can_open_me_if_install_and_regeister_this_scheme", 0)
			}
		},
		hasApp : function(k, l, j) {
			if ( typeof WeixinJSBridge != "undefined") {
				WeixinJSBridge.invoke("getInstallState", {
					packageName : k,
					packageUrl : l
				}, function(p) {
					var q = p.err_msg;
					if (q.indexOf("get_install_state:yes") > -1) {
						if (j) {
							var o = q.split("_");
							var m = o.length > 0 ? Number(o[o.length - 1]) : 0;
							if (k == "com.tencent.news") {
								openAppController.newsVersion = m
							}
							if (m >= j) {
								openAppController.installCallback(k, true)
							} else {
								openAppController.installCallback(k, false)
							}
						} else {
							openAppController.installCallback(k, true)
						}
					} else {
						openAppController.installCallback(k, false)
					}
				})
			} else {
				openAppController.installCallback(k, false)
			}
		},
		installCallback : function(k, j) {
			if (k == "com.tencent.news") {
				openAppController.isInstallNews = j
			} else {
				if (k == "com.tencent.qqlive") {
					openAppController.isInstallLive = j
				} else {
					if (k == "com.tencent.weishi" || k == "com.tencent.microvision") {
						openAppController.isInstallWeishi = j
					}
				}
			}
			if ((openAppController.isInstallNews == undefined || openAppController.isInstallLive == undefined || openAppController.isInstallWeishi == undefined) && !openAppController.isIpad) {
				return
			}
			openAppController.moduleLoad();
			var m = navigator.userAgent.toLowerCase();
			var l = /android/i.test(m) ? true : false;
			if (l) {
				downloader.queryDownloadState("news");
				downloader.queryDownloadState("video");
				downloader.queryDownloadState("weishi")
			}
		},
		bottomBtnLoad : function() {
			if (openAppController.isIpad) {
				if (!openAppController.isInstallNews) {
					openAppController.showDownload()
				} else {
					openAppController.callBack()
				}
			} else {
				if (enforceForVideo) {
					if (!openAppController.isInstallLive) {
						openAppController.showVideoDownload()
					} else {
						if (!openAppController.isInstallNews) {
							openAppController.showDownload()
						} else {
							if (!openAppController.isInstallWeishi && isShowWeishi) {
								openAppController.showWeishiDownload()
							} else {
								openAppController.callBack()
							}
						}
					}
				} else {
					if (!openAppController.isInstallNews) {
						openAppController.showDownload()
					} else {
						if (!openAppController.isInstallLive && isShowVideo) {
							openAppController.showVideoDownload()
						} else {
							if (!openAppController.isInstallWeishi && isShowWeishi) {
								openAppController.showWeishiDownload()
							} else {
								openAppController.callBack()
							}
						}
					}
				}
			}
		},
		moduleLoad : function() {
			if (!openAppController.isInstallNews) {
				openAppController.showModuleDownload();
				openAppController.sendBoss("uninstallNews")
			} else {
				openAppController.showModuleOpen();
				openAppController.sendBoss("installNews");
				openAppController.bindModuleClick("news");
				openAppController.showCommentBannerNew()
			}
			if (!openAppController.isInstallLive) {
				openAppController.showModuleDownloadVideo();
				openAppController.sendBoss("uninstallVideo")
			} else {
				openAppController.showModuleOpenVideo();
				openAppController.sendBoss("installVideo");
				openAppController.bindModuleClick("video")
			}
		},
		showModuleDownload : function() {
			if (openAppController.newsDownloadState != 1) {
				return
			}
			openAppController.newsDownloadState = 1;
			var m = document.querySelectorAll(".unified_downloader");
			if (!m) {
				return
			}
			for (var j = 0, q = m.length; j < q; j++) {
				var l = m[j];
				var p = l.id;
				if (!p || !moduleInfo) {
					continue
				}
				var k = moduleInfo[p];
				if (!k) {
					
					continue
				}
				if (l.getAttribute("type") == "news" || !l.getAttribute("type")) {
					if (openAppController.isIpad) {
						l.href = ipadDownloadUrl + "&reqkey=" + d() + "&mmuin=" + b(g("mmuin")) + "&openid=" + Q.getQuery(document.location.href, "openid")
					} else {
						l.href = downloadUrl + "&reqkey=" + d() + "&mmuin=" + b(g("mmuin")) + "&openid=" + Q.getQuery(document.location.href, "openid")
					}
					var o = l.querySelector(".downloader_text");
					o.innerHTML = k.downloadText;
					l.style.visibility = "visible"
				}
			}
		},
		showModuleOpen : function() {
			openAppController.newsDownloadState = 3;
			var p = document.querySelectorAll(".unified_downloader");
			if (!p) {
				return
			}
			for (var o = 0, l = p.length; o < l; o++) {
				var r = p[o];
				var k = r.id;
				if (!k || !moduleInfo) {
					continue
				}
				var m = moduleInfo[k];
				if (!m) {
					continue
				}
				if (r.getAttribute("type") == "news" || !r.getAttribute("type")) {
					r.className = "unified_downloader downloader_open";
					var j;
					if (openAppController.isIpad) {
						j = m.ipadOpenUrl
					} else {
						j = m.openUrl
					}
					var s = "V1_135_" + newsId;
					r.href = j + (j.indexOf("?") == -1 ? "?" : "&") + "from=" + s;
					var q = r.querySelector(".downloader_text");
					q.innerHTML = m.openText;
					r.style.visibility = "visible"
				}
			}
		},
		showModuleDownloadVideo : function() {
			if (openAppController.videoDownloadState != 1) {
				return
			}
			openAppController.videoDownloadState = 1;
			var m = document.querySelectorAll(".unified_downloader");
			if (!m) {
				return
			}
			for (var j = 0, q = m.length; j < q; j++) {
				var l = m[j];
				var p = l.id;
				if (!p || !moduleInfo) {
					continue
				}
				var k = moduleInfo[p];
				if (!k) {
					continue
				}
				if (l.getAttribute("type") == "video") {
					l.href = downloadVideoUrl + "&reqkey=" + d() + "&mmuin=" + b(g("mmuin")) + "&openid=" + Q.getQuery(document.location.href, "openid");
					var o = l.querySelector(".downloader_text");
					o.innerHTML = k.downloadText;
					l.style.visibility = "visible"
				}
			}
		},
		showModuleOpenVideo : function() {
			openAppController.videoDownloadState = 3;
			var m = document.querySelectorAll(".unified_downloader");
			if (!m) {
				return
			}
			for (var j = 0, q = m.length; j < q; j++) {
				var l = m[j];
				var p = l.id;
				if (!p || !moduleInfo) {
					continue
				}
				var k = moduleInfo[p];
				if (!k) {
					continue
				}
				if (l.getAttribute("type") == "video") {
					l.className = "unified_downloader downloader_open";
					l.href = k.openUrl;
					var o = l.querySelector(".downloader_text");
					o.innerHTML = k.openText;
					l.style.visibility = "visible"
				}
			}
		},
		showCommentBannerNew : function() {
			var l = document.querySelector("#comment_banner_new");
			if (!l || l.style.display == "block") {
				return
			}
			var k = l.querySelector(".comment_banner_new_num");
			if (k) {
				var o = Number(k.innerText)
			}
			if (o == 0) {
				var m = "打开腾讯新闻，参与讨论";
				var j = l.querySelector("p");
				j.innerHTML = m
			} else {
				if (o < 1000) {
				} else {
					if (o >= 1000 && o < 10000) {
						Q.addClass(k, "less-comment")
					} else {
						k.innerText = openAppController.transNum(o);
						Q.addClass(k, "more-comment")
					}
				}
			}
			l.style.display = "block";
			l.addEventListener("click", openAppController.commentBannerClick)
		},
		transNum : function(j) {
			switch(true) {
				case j==0:
					re = "";
					break;
				case j<10000:
					re = j;
					break;
				case j<100000000:
					re = parseFloat(j / 10000).toFixed(1) + "万";
					break;
				default:
					re = parseFloat(j / 100000000).toFixed(1) + "亿";
					break
			}
			return re
		},
		commentBannerClick : function(j) {
			openAppController.sendBoss("open_comment_click")
		},
		bindModuleClick : function(j) {
			if (j == "news") {
				var m = document.querySelectorAll(".atlas_imgArea,.rn_imgArea");
				for (var k = 0, o = m.length; k < o; k++) {
					var l = m[k];
					l.addEventListener("click", openAppController.moduleImgClick)
				}
			}
			if (j == "video") {
				var m = document.querySelectorAll(".videoClips_imgArea");
				for (var k = 0, o = m.length; k < o; k++) {
					var l = m[k];
					l.addEventListener("click", openAppController.moduleImgClick)
				}
			}
		},
		moduleImgClick : function(m) {
			var l = m.currentTarget;
			var k = l.parentNode;
			if (!k) {
				return
			}
			var o = k.querySelector(".unified_downloader");
			if (downloader) {
				downloader.sendbossInit(o);
				var j = o.href;
				h.location.href = j
			}
		},
		formatDate : function(l) {
			var k = new Date(l * 1000);
			var m = new Date();
			var j = parseInt((m.getTime() - k.getTime()) / 1000);
			if (j < 0) {
				re = "0秒"
			} else {
				if (j >= 60 * 60 * 24) {
					re = parseInt(j / (60 * 60 * 24)) + "天"
				} else {
					if (j >= 60 * 60) {
						re = parseInt(j / (60 * 60)) + "小时"
					} else {
						if (j >= 60) {
							re = parseInt(j / 60) + "分钟"
						} else {
							re = j + "秒"
						}
					}
				}
				re += "前"
			}
			return re
		},
		asyncShowFloatDownload : function() {
			var j = document.createElement("script");
			j.type = "text/javascript";
			j.async = true;
			j.charset = "charset";
			j.onload = function() {
			};
			j.src = "http://mat1.gtimg.com/www/js/newsapp/wechat/downloadController.min.js";
			var k = document.getElementsByTagName("script")[0];
			k.parentNode.insertBefore(j, k)
		},
		getQuery : function(k, l) {
			var m = new RegExp("(^|&|\\?|#)" + l + "=([^&#]*)(&|$|#)", "");
			var j = k.match(m);
			if (j) {
				return j[2]
			}
			return ""
		},
		time2txt : function(l, p) {
			var o = new Date(l * 1000);
			var q = p ? new Date(p * 1000) : new Date();
			var m = new Date((Math.floor((q.getTime() + 60 * 60 * 8 * 1000) / (60 * 60 * 24 * 1000)) * 60 * 60 * 24 * 1000));
			var j = Math.floor((o.getTime() + 60 * 60 * 8 * 1000) / (60 * 60 * 24 * 1000));
			var r = Math.floor(m / (60 * 60 * 24 * 1000));
			var k = r - j;
			var s = parseInt((q.getTime() - o.getTime()) / 1000);
			var t;
			switch(true) {
				case s<0:
					t = "刚刚";
					break;
				case s<60:
					t = s + "秒前";
					break;
				case s<60*60:
					t = parseInt(s / 60) + "分钟前";
					break;
				case s<60*60*24:
					if (k == 1) {
						t = "昨天" + o.getHours() + "点" + o.getMinutes() + "分"
					} else {
						t = parseInt(s / (60 * 60)) + "小时前"
					}
					break;
				case s<60*60*48:
					if (k == 2) {
						t = "前天" + o.getHours() + "点" + o.getMinutes() + "分"
					} else {
						t = "昨天" + o.getHours() + "点" + o.getMinutes() + "分"
					}
					break;
				case s<60*60*72:
					if (k == 2) {
						t = "前天"
					} else {
						t = (o.getMonth() + 1) + "月" + o.getDate() + "日"
					}
					break;
				default:
					t = (o.getMonth() + 1) + "月" + o.getDate() + "日"
			}
			return t
		},
		reformTime : function() {
			var m = document.querySelectorAll(".time_need_reform");
			for ( i = 0, n = m.length; i < n; i++) {
				var l = m[i];
				var k = l.getAttribute("time");
				var j = openAppController.time2txt(k);
				l.innerHTML += j
			}
		},
		reformComment : function() {
			var m = document.querySelectorAll(".comment .c_text");
			for (var k = 0, p = m.length; k < p; k++) {
				var l = m[k];
				var o = l.innerHTML;
				var j = Math.floor((openAppController.contentW - 60) / 15) * 5 - 10;
				l.innerHTML = o.length < j ? o : o.slice(0, j) + "……"
			}
		},
		sendbossInit : function(k, l) {
			var j = [];
			if (l.indexOf("atlas") != -1) {
				j.push("atlas")
			} else {
				if (l.indexOf("comment") != -1) {
					j.push("comment")
				} else {
					if (l.indexOf("relatedNews") != -1) {
						j.push("relatedNews")
					} else {
						if (l.indexOf("videoClips") != -1) {
							j.push("videoClips")
						} else {
							j.push("others")
						}
					}
				}
			}
			j.push(k);
			openAppController.sendBoss(j.join("_"))
		},
		sendBoss : function(l) {
			var k = document.location.href;
			var m = [];
			m.push("sIp=");
			m.push("iQQ=" + (this.getQuery(k, "mmuin") || this.getQuery(k, "openid")));
			m.push("sBiz=" + encodeURIComponent("appnews.front.newsOpen"));
			m.push("sOp=" + l);
			m.push("iSta=0");
			m.push("iTy=1702");
			m.push("iFlow=");
			m.push("sOsType=" + mobileType);
			m.push("sNewsId=" + newsId);
			m.push("sGroupId=" + this.getQuery(k, "groupid"));
			m.push("sMsgId=" + this.getQuery(k, "msgid"));
			m.push("sDt=" + this.getQuery(k, "dt"));
			m.push("sCv=" + this.getQuery(k, "cv"));
			m.push("sRefer=" + this.getQuery(k, "refer"));
			var j = new Image();
			j.onload = function() {
			};
			j.src = "http://btrace.qq.com/collect?" + m.join("&")
		}
	}
}(window);
var showMoreNews = {
	isBeginHide : false,
	init : function() {
		var b = Q("#content .text, #content .preLoad, #content .truthContainer .truthHeader, h1, h2, h3, .introduction, .atlas, .map,.videoClips");
		for (var a = 0, g = b.length; a < g; a++) {
			var f = b[a];
			var d = f.innerHTML;
			if (showMoreNews.isBeginHide) {
				Q.addClass(f, "showMoreHide")
			} else {
				if (Q.hasClass(f, "map")) {
					f.style.display = "block"
				}
			}
			if (/\$\$\$/i.test(d)) {
				f.innerHTML = d.replace(/<\!\-\-\$\$\$\-\->|\$\$\$/ig, "");
				showMoreNews.createMoreHTML(f);
				showMoreNews.isBeginHide = true
			}
		}
	},
	createMoreHTML : function(a) {
		var b = document.createElement("div");
		b.id = "showMore";
		if (showMoreNews.isBeginHide) {
			b.className = "showMoreAll showMoreHide"
		} else {
			b.className = "showMoreAll"
		}
		b.innerHTML = '<span class="showMore" hideFocus="true">点击展开全文</span>';
		b.style.cssText = "textAlign:center,margin:0 -16px 30px";
		a.parentNode.insertBefore(b, a.nextSibling);
		Q.tap(b, showMoreNews.clickHandle)
	},
	removeMoreHTML : function() {
		var a = Q(".showMoreAll");
		var a = (a && a.length > 0) ? a[0] : a;
		a.parentNode.removeChild(a)
	},
	clickHandle : function() {
		var b = Q("#content .showMoreHide");
		if (b.length == 0) {
			return
		}
		var a = b[0];
		if (Q.hasClass(a, "map")) {
			setTimeout(function() {
				showMoreNews.timeOutShow(b)
			}, 400)
		} else {
			showMoreNews.timeOutShow(b)
		}
	},
	timeOutShow : function(b) {
		var d = Q("#content .showMoreHide");
		for (var a = 0, g = d.length; a < g; a++) {
			var f = d[a];
			Q.removeClass(f, "showMoreHide");
			if (Q.hasClass(f, "map")) {
				f.style.display = "block"
			}
			if (f.id == "showMore") {
				break
			}
		}
		showMoreNews.removeMoreHTML()
	}
};
var weChatBridgeReady = {
	init : function() {
		weChatBridgeReady.bindShareWithApp();
		weChatBridgeReady.bindShareWithTimeline();
		var f = Q("img");
		for (var b = 0, d = f.length; b < d; b++) {
			var a = f[b];
			Q.tap(a, weChatBridgeReady.clickHandler)
		}
	},
	clickHandler : function() {
		if (this.className == "download") {
			return
		}
		var d = [], g = Q("img");
		for (var a = 0, f = g.length; a < f; a++) {
			var b = g[a];
			if (b.parenNode.parenNode.id = "DownloadBar") {
				continue
			}
			if (b.className == "download") {
				continue
			}
			d.push(b.src)
		}
		WeixinJSBridge.invoke("imagePreview", {
			current : e.target.src,
			urls : d
		})
	},
	bindShareWithApp : function() {
		var a = document.location.href;
		var b = Q.delQueryValue(a, "mmuin");
		b = Q.delQueryValue(b, "openid");
		if (!(a.indexOf("isShare=1") > -1)) {
			b = b.indexOf("?") != -1 ? b + "&isShare=1" : b + "?isShare=1"
		}
		WeixinJSBridge.on("menu:share:appmessage", function(d) {
			WeixinJSBridge.invoke("sendAppMessage", {
				appid : "",
				img_url : contentModel.img_url,
				img_width : "65",
				img_height : "65",
				link : b,
				desc : contentModel.desc,
				title : contentModel.title
			}, function(f) {
				WeixinJSBridge.log(f.err_msg)
			})
		})
	},
	bindShareWithTimeline : function() {
		var a = document.location.href;
		var b = Q.delQueryValue(a, "mmuin");
		b = Q.delQueryValue(b, "openid");
		if (!(a.indexOf("isShare=1") > -1)) {
			b = b.indexOf("?") != -1 ? b + "&isShare=1" : b + "?isShare=1"
		}
		WeixinJSBridge.on("menu:share:timeline", function(d) {
			WeixinJSBridge.invoke("shareTimeline", {
				img_url : contentModel.img_url,
				img_width : "65",
				img_height : "65",
				link : b,
				desc : "view.inews.qq.com",
				title : contentModel.title
			}, function(f) {
				WeixinJSBridge.log(f.err_msg)
			})
		})
	}
};
var downloader = {
	isPreventDefault : true,
	init : function() {
		var k = navigator.userAgent.toLowerCase();
		var d = /android/i.test(k) ? true : false;
		if (!d) {
			downloader.isPreventDefault = false
		} else {
			try {
				var b = [];
				b = k.match(/microMessenger\/(\d)\.([0-9.]+)/);
				if (b.length > 1) {
					var g = Number(b[1]);
					if (g < 5) {
						downloader.isPreventDefault = false
					}
				}
			} catch(f) {
			}
		}
		var j = Q("#imgdownload");
		if (j.length > 0) {
			var a = j[0];
			if ("touchstart" in document.documentElement) {
				a.addEventListener("touchstart", downloader.clickHandler)
			} else {
				a.addEventListener("click", downloader.clickHandler)
			}
		}
		var h = document.querySelectorAll(".unified_downloader");
		if (h.length > 0) {
			for ( i = 0, n = h.length; i < n; i++) {
				var a = h[i];
				if ("touchstart" in document.documentElement) {
					Q.tap(a, downloader.moduleClick)
				} else {
					a.addEventListener("click", downloader.moduleClick)
				}
			}
		}
		if ( typeof WeixinJSBridge != "undefined" && WeixinJSBridge.on) {
			WeixinJSBridge.on("wxdownload:state_change", downloader.downloadStateChange)
		} else {
			document.addEventListener("WeixinJSBridgeReady", function() {
				if ( typeof WeixinJSBridge != "undefined" && WeixinJSBridge.on) {
					WeixinJSBridge.on("wxdownload:state_change", downloader.downloadStateChange)
				}
			})
		}
	},
	queryDownloadState : function(a) {
		if ( typeof WeixinJSBridge != "undefined" && WeixinJSBridge.on) {
			if (WeixinJSBridge.invoke) {
				if (a == "news") {
					downloadClick.queryDownloadState()
				} else {
					if (a == "video") {
						downloadClickVideo.queryDownloadState()
					} else {
						if (a == "weishi") {
							downloadClickWeishi.queryDownloadState()
						}
					}
				}
			}
		} else {
			document.addEventListener("WeixinJSBridgeReady", function() {
				if (a == "news") {
					downloadClick.queryDownloadState()
				} else {
					if (a == "video") {
						downloadClickVideo.queryDownloadState()
					} else {
						if (a == "weishi") {
							downloadClickWeishi.queryDownloadState()
						}
					}
				}
			})
		}
	},
	downloadStateChange : function(a) {
		if (a && a.state) {
			if (a.download_id == downloadInit.newsDownloadValue) {
				downloadClick.downloadStateChange(a)
			} else {
				if (a.download_id == downloadInit.videoDownloadValue) {
					downloadClickVideo.downloadStateChange(a)
				} else {
					if (a.download_id == Q.getData(downloadClickWeishi.downloadId)) {
						downloadClickWeishi.downloadStateChange(a)
					}
				}
			}
			if ( typeof transferDownloadState === "function" && a.download_id && (a.download_id != downloadInit.newsDownloadValue || a.download_id != downloadInit.videoDownloadValue || a.download_id != Q.getData(downloadClickWeishi.downloadId))) {
				transferDownloadState(a)
			}
		}
	},
	clickHandler : function(b) {
		var a = b.target;
		if (a.tagName.toLowerCase() != "a") {
			a = Q.parent(a, function(f) {
				return (f.tagName.toLowerCase() == "a") ? true : false
			})
		}
		var d = a.getAttribute("app");
		if (d == "news") {
			downloadClick.clickHandler(b)
		} else {
			if (d == "video") {
				downloadClickVideo.clickHandler(b)
			} else {
				if (d == "weishi") {
					downloadClickWeishi.clickHandler(b)
				}
			}
		}
		if (downloader.isPreventDefault) {
			b.preventDefault()
		}
	},
	moduleClick : function(b) {
		var a = b.target;
		if (!Q.hasClass(a, "unified_downloader")) {
			a = Q.parent(a, function(d) {
				return (Q.hasClass(d, "unified_downloader")) ? true : false
			})
		}
		if (a.getAttribute("type") == "video") {
			if (Q.hasClass(a, "downloader_downloading")) {
				downloadClickVideo.stopDownload(a)
			} else {
				if (Q.hasClass(a, "downloader_download")) {
					downloadClickVideo.startDownload(a)
				} else {
					if (Q.hasClass(a, "downloader_install")) {
						downloadClickVideo.installDownload(a)
					}
				}
			}
		} else {
			if (Q.hasClass(a, "downloader_downloading")) {
				downloadClick.stopDownload(a)
			} else {
				if (Q.hasClass(a, "downloader_download")) {
					downloadClick.startDownload(a)
				} else {
					if (Q.hasClass(a, "downloader_install")) {
						downloadClick.installDownload(a)
					}
				}
			}
		}
		if (!Q.hasClass(a, "downloader_open") && downloader.isPreventDefault) {
			b.preventDefault()
		}
		downloader.sendbossInit(a)
	},
	sendbossInit : function(b) {
		var a = [];
		if (Q.hasClass(b, "downloader_downloading")) {
			a.push("downloading")
		} else {
			if (Q.hasClass(b, "downloader_install")) {
				a.push("install")
			} else {
				if (Q.hasClass(b, "downloader_open")) {
					a.push("open")
				} else {
					if (Q.hasClass(b, "downloader_download")) {
						a.push("download")
					}
				}
			}
		}
		var d = b.id;
		if (d.indexOf("atlas") != -1) {
			a.push("atlas")
		} else {
			if (d.indexOf("comment") != -1) {
				a.push("comment")
			} else {
				if (d.indexOf("relatedNews") != -1) {
					a.push("relatedNews")
				} else {
					if (d.indexOf("videoClips") != -1) {
						a.push("videoClips")
					} else {
						a.push("others")
					}
				}
			}
		}
		a.push("click");
		openAppController.sendBoss(a.join("_"))
	},
};
downloader.init();
var downloadClick = {
	downloadId : "downloadId",
	taskName : "TencentNews",
	queryDownloadState : function() {
		var a = downloadInit.newsDownloadValue;
		if (a) {
			WeixinJSBridge.invoke("queryDownloadTask", {
				download_id : a
			}, function(b) {
				downloadClick.downloadStateChange(b)
			})
		}
	},
	downloadStateChange : function(a) {
		if (a && a.state) {
			if (!a.download_id || a.download_id == downloadInit.newsDownloadValue) {
				if (a.state == "download_succ") {
					downloadClick.downloadComplete()
				}
				if (a.state == "default") {
				}
				if (a.state == "downloading") {
					downloadClick.showDownloading()
				}
				if (a.state == "download_fail") {
					downloadClick.clearTask()
				}
			}
		}
	},
	clickHandler : function(b) {
		var a = b.target;
		if (a.tagName.toLowerCase() != "a") {
			a = Q.parent(a, function(d) {
				return (d.tagName.toLowerCase() == "a") ? true : false
			})
		}
		if (Q.hasClass(a, "client_new_downloading")) {
			downloadClick.stopDownload(a)
		} else {
			if (Q.hasClass(a, "client_new_tips")) {
				downloadClick.startDownload(a)
			} else {
				if (Q.hasClass(a, "client_new_install")) {
					downloadClick.installDownload(a)
				}
			}
		}
	},
	startDownload : function(b) {
		var a = b.href;
		if ( typeof WeixinJSBridge != "undefined" && WeixinJSBridge.invoke) {
			WeixinJSBridge.invoke("addDownloadTask", {
				task_name : downloadClick.taskName,
				task_url : a,
				file_md5 : downloadMd5
			}, function(f) {
				var h = f.err_msg;
				if (h.indexOf("add_download_task:ok") > -1) {
					var g = f.download_id;
					var d = downloadInit.newsDownloadName;
					downloadInit.newsDownloadValue = g;
					Q.setData(d, g);
					downloadClick.showDownloading();
					openAppController.sendBoss("startDownLoad");
					if (document.location.href.indexOf("isShare=1") == -1) {
						Q.remoteSetData(d, g, function(j) {
						})
					}
				} else {
					downloader.isPreventDefault = false
				}
			})
		} else {
			downloader.isPreventDefault = false
		}
	},
	showDefaultState : function() {
		var d = document.getElementById("imgdownload");
		if (d && d.getAttribute("app") == "news") {
			downloadClick.clearStyle(d);
			Q.addClass(d, "client_new_tips");
			var k = d.querySelector("span.down-text");
			if (k) {
				k.innerHTML = "下载腾讯新闻客户端"
			}
		}
		var j = document.querySelectorAll(".unified_downloader");
		if (!j) {
			return
		}
		for (var h = 0, f = j.length; h < f; h++) {
			var m = j[h];
			var b = m.id;
			if (!b || !moduleInfo) {
				continue
			}
			var g = moduleInfo[b];
			if (!g) {
				continue
			}
			if (m && m.getAttribute("type") == "news") {
				var l = m.querySelector(".downloader_text");
				l.innerHTML = g.downloadText;
				var a = m.querySelector(".downloader_progress");
				if (a) {
					a.style.display = "none"
				}
				downloadClick.clearModuleStyle(m);
				Q.addClass(m, "downloader_download")
			}
		}
	},
	showDownloading : function() {
		openAppController.newsDownloadState = 2;
		var d = document.getElementById("imgdownload");
		if (d && d.getAttribute("app") == "news") {
			downloadClick.clearStyle(d);
			Q.addClass(d, "client_new_downloading");
			var k = d.querySelector("span.down-text");
			if (k) {
				k.innerHTML = "正下载腾讯新闻客户端"
			}
		}
		var j = document.querySelectorAll(".unified_downloader");
		if (!j) {
			return
		}
		for (var h = 0, f = j.length; h < f; h++) {
			var m = j[h];
			var b = m.id;
			if (!b || !moduleInfo) {
				break
			}
			var g = moduleInfo[b];
			if (!g) {
				break
			}
			if (m && m.getAttribute("type") == "news") {
				var l = m.querySelector(".downloader_text");
				l.innerHTML = "正下载腾讯新闻客户端";
				var a = m.querySelector(".downloader_progress");
				if (a) {
					a.style.display = "block"
				}
				downloadClick.clearModuleStyle(m);
				Q.addClass(m, "downloader_downloading")
			}
		}
	},
	clearTask : function() {
		if (window.localStorage && localStorage.removeItem) {
			try {
				window.localStorage.clear()
			} catch(b) {
				window.localStorage.clear()
			}
		}
		var a = downloadInit.newsDownloadName;
		Q.remoteSetData(a, "", function(d) {
		})
	},
	downloadComplete : function() {
		if (openAppController.newsDownloadState == 3) {
			return
		}
		openAppController.newsDownloadState = 2;
		var d = document.getElementById("imgdownload");
		if (d && d.getAttribute("app") == "news") {
			downloadClick.clearStyle(d);
			Q.addClass(d, "client_new_install");
			var k = d.querySelector("span.down-text");
			if (k) {
				k.innerHTML = '<span class="down-text1">下载已完成，</span><span class="down-text2">直接打开腾讯新闻</span>'
			}
		}
		var j = document.querySelectorAll(".unified_downloader");
		if (!j) {
			return
		}
		for (var h = 0, f = j.length; h < f; h++) {
			var m = j[h];
			var b = m.id;
			if (!b || !moduleInfo) {
				break
			}
			var g = moduleInfo[b];
			if (!g) {
				break
			}
			if (m && m.getAttribute("type") == "news") {
				var l = m.querySelector(".downloader_text");
				l.innerHTML = "安装腾讯新闻客户端";
				var a = m.querySelector(".downloader_progress");
				if (a) {
					a.style.display = "none"
				}
				downloadClick.clearModuleStyle(m);
				Q.addClass(m, "downloader_install")
			}
		}
		openAppController.sendBoss("succDownLoad")
	},
	stopDownload : function(a) {
		var b = downloadInit.newsDownloadValue;
		if (b && typeof WeixinJSBridge != "undefined" && WeixinJSBridge.invoke) {
			WeixinJSBridge.invoke("cancelDownloadTask", {
				download_id : b,
				file_md5 : downloadMd5
			}, function(d) {
				var f = d.err_msg;
				if (f.indexOf("cancel_download_task:ok") > -1) {
					downloadClick.showDefaultState();
					openAppController.sendBoss("stopDownLoad")
				} else {
					downloader.isPreventDefault = false
				}
			})
		} else {
			downloader.isPreventDefault = false
		}
	},
	clearStyle : function(a) {
		Q.removeClass(a, "client_new_install");
		Q.removeClass(a, "client_new_downloading");
		Q.removeClass(a, "client_new_tips")
	},
	clearModuleStyle : function(a) {
		Q.removeClass(a, "downloader_download");
		Q.removeClass(a, "downloader_downloading");
		Q.removeClass(a, "downloader_install")
	},
	installDownload : function(a) {
		var b = downloadInit.newsDownloadValue;
		if (b && typeof WeixinJSBridge != "undefined" && WeixinJSBridge.invoke) {
			WeixinJSBridge.invoke("installDownloadTask", {
				download_id : b,
				file_md5 : downloadMd5
			}, function(d) {
				var f = d.err_msg;
				if (f.indexOf("install_download_task:ok") > -1) {
					var g = setInterval(function() {
						if (true) {
							clearInterval(g)
						}
						openAppController.checkIsInstall()
					}, 500);
					openAppController.sendBoss("installNewsApp")
				} else {
					downloader.isPreventDefault = false
				}
			})
		} else {
			downloader.isPreventDefault = false
		}
	}
};
var downloadClickVideo = {
	downloadId : "VideodownloadId",
	taskName : "TencentVideo",
	queryDownloadState : function() {
		var a = downloadInit.videoDownloadValue;
		if (a) {
			WeixinJSBridge.invoke("queryDownloadTask", {
				download_id : a
			}, function(b) {
				downloadClickVideo.downloadStateChange(b)
			})
		}
	},
	downloadStateChange : function(a) {
		if (a && a.state) {
			if (!a.download_id || a.download_id == downloadInit.videoDownloadValue) {
				if (a.state == "download_succ") {
					downloadClickVideo.downloadComplete()
				}
				if (a.state == "default") {
				}
				if (a.state == "downloading") {
					downloadClickVideo.showDownloading()
				}
				if (a.state == "download_fail") {
					downloadClickVideo.clearTask()
				}
			}
		}
	},
	clickHandler : function(b) {
		var a = b.target;
		if (a.tagName.toLowerCase() != "a") {
			a = Q.parent(a, function(d) {
				return (d.tagName.toLowerCase() == "a") ? true : false
			})
		}
		if (Q.hasClass(a, "client_video_new_downloading")) {
			downloadClickVideo.stopDownload(a)
		} else {
			if (Q.hasClass(a, "client_video_new_tips")) {
				downloadClickVideo.startDownload(a)
			} else {
				if (Q.hasClass(a, "client_video_new_install")) {
					downloadClickVideo.installDownload(a)
				}
			}
		}
	},
	startDownload : function(b) {
		var a = b.href;
		if ( typeof WeixinJSBridge != "undefined" && WeixinJSBridge.invoke) {
			WeixinJSBridge.invoke("addDownloadTask", {
				task_name : downloadClickVideo.taskName,
				task_url : a,
				file_md5 : downloadVideoMD5
			}, function(f) {
				var h = f.err_msg;
				if (h.indexOf("add_download_task:ok") > -1) {
					var g = f.download_id;
					var d = downloadInit.videoDownloadName;
					downloadInit.videoDownloadValue = g;
					Q.setData(d, g);
					downloadClickVideo.showDownloading();
					openAppController.sendBoss("startDownLoadVideo");
					if (document.location.href.indexOf("isShare=1") == -1) {
						Q.remoteSetData(d, g, function(j) {
						})
					}
				} else {
					downloader.isPreventDefault = false
				}
			})
		} else {
			downloader.isPreventDefault = false
		}
	},
	showDefaultState : function() {
		var d = document.getElementById("imgdownload");
		if (d && d.getAttribute("app") == "video") {
			downloadClickVideo.clearStyle(d);
			Q.addClass(d, "client_video_new_tips");
			var k = d.querySelector("span.down-text");
			if (k) {
				k.innerHTML = "下载腾讯视频客户端"
			}
		}
		var j = document.querySelectorAll(".unified_downloader");
		if (!j) {
			return
		}
		for (var h = 0, f = j.length; h < f; h++) {
			var m = j[h];
			var b = m.id;
			if (!b || !moduleInfo) {
				continue
			}
			var g = moduleInfo[b];
			if (!g) {
				continue
			}
			if (m && m.getAttribute("type") == "video") {
				var l = m.querySelector(".downloader_text");
				l.innerHTML = g.downloadText;
				var a = m.querySelector(".downloader_progress");
				if (a) {
					a.style.display = "none"
				}
				downloadClick.clearModuleStyle(m);
				Q.addClass(m, "downloader_download")
			}
		}
	},
	showDownloading : function() {
		openAppController.videoDownloadState = 2;
		var d = document.getElementById("imgdownload");
		if (d && d.getAttribute("app") == "video") {
			downloadClickVideo.clearStyle(d);
			Q.addClass(d, "client_video_new_downloading");
			var k = d.querySelector("span.down-text");
			if (k) {
				k.innerHTML = "正下载腾讯视频客户端"
			}
		}
		var j = document.querySelectorAll(".unified_downloader");
		if (!j) {
			return
		}
		for (var h = 0, f = j.length; h < f; h++) {
			var m = j[h];
			var b = m.id;
			if (!b || !moduleInfo) {
				break
			}
			var g = moduleInfo[b];
			if (!g) {
				break
			}
			if (m && m.getAttribute("type") == "video") {
				var l = m.querySelector(".downloader_text");
				l.innerHTML = "正下载腾讯视频客户端";
				var a = m.querySelector(".downloader_progress");
				if (a) {
					a.style.display = "block"
				}
				downloadClick.clearModuleStyle(m);
				Q.addClass(m, "downloader_downloading")
			}
		}
	},
	clearTask : function() {
		if (window.localStorage && localStorage.removeItem) {
			try {
				window.localStorage.clear()
			} catch(b) {
				window.localStorage.clear()
			}
		}
		var a = downloadInit.videoDownloadName;
		Q.remoteSetData(a, "", function(d) {
		})
	},
	downloadComplete : function() {
		if (openAppController.videoDownloadState == 3) {
			return
		}
		openAppController.videoDownloadState = 2;
		var d = document.getElementById("imgdownload");
		if (d && d.getAttribute("app") == "video") {
			downloadClickVideo.clearStyle(d);
			Q.addClass(d, "client_video_new_install");
			var k = d.querySelector("span.down-text");
			if (k) {
				k.innerHTML = '<span class="down-text1">下载已完成，</span><span class="down-text2">直接打开腾讯视频</span>'
			}
		}
		var j = document.querySelectorAll(".unified_downloader");
		if (!j) {
			return
		}
		for (var h = 0, f = j.length; h < f; h++) {
			var m = j[h];
			var b = m.id;
			if (!b || !moduleInfo) {
				break
			}
			var g = moduleInfo[b];
			if (!g) {
				break
			}
			if (m && m.getAttribute("type") == "video") {
				var l = m.querySelector(".downloader_text");
				l.innerHTML = "安装腾讯视频客户端";
				var a = m.querySelector(".downloader_progress");
				if (a) {
					a.style.display = "none"
				}
				downloadClick.clearModuleStyle(m);
				Q.addClass(m, "downloader_install")
			}
		}
		openAppController.sendBoss("succDownLoadVideo")
	},
	stopDownload : function(a) {
		var b = downloadInit.videoDownloadValue;
		if (b && typeof WeixinJSBridge != "undefined" && WeixinJSBridge.invoke) {
			WeixinJSBridge.invoke("cancelDownloadTask", {
				download_id : b,
				file_md5 : downloadVideoMD5
			}, function(d) {
				var f = d.err_msg;
				if (f.indexOf("cancel_download_task:ok") > -1) {
					downloadClickVideo.showDefaultState();
					openAppController.sendBoss("stopDownLoadVideo")
				} else {
					downloader.isPreventDefault = false
				}
			})
		} else {
			downloader.isPreventDefault = false
		}
	},
	clearStyle : function(a) {
		Q.removeClass(a, "client_new_install");
		Q.removeClass(a, "client_new_downloading");
		Q.removeClass(a, "client_new_tips");
		Q.removeClass(a, "client_video_new_install");
		Q.removeClass(a, "client_video_new_downloading");
		Q.removeClass(a, "client_video_new_tips")
	},
	clearModuleStyle : function(a) {
		Q.removeClass(a, "downloader_download");
		Q.removeClass(a, "downloader_downloading");
		Q.removeClass(a, "downloader_install")
	},
	installDownload : function(a) {
		var b = downloadInit.videoDownloadValue;
		if (b && typeof WeixinJSBridge != "undefined" && WeixinJSBridge.invoke) {
			WeixinJSBridge.invoke("installDownloadTask", {
				download_id : b,
				file_md5 : downloadVideoMD5
			}, function(d) {
				var f = d.err_msg;
				if (f.indexOf("install_download_task:ok") > -1) {
					var g = setInterval(function() {
						if (true) {
							clearInterval(g)
						}
						openAppController.checkIsInstall()
					}, 500);
					openAppController.sendBoss("installNewsAppVideo")
				} else {
					downloader.isPreventDefault = false
				}
			})
		} else {
			downloader.isPreventDefault = false
		}
	}
};
var downloadClickWeishi = {
	downloadId : "WeishidownloadId",
	taskName : "微视",
	queryDownloadState : function() {
		var a = Q.getData(downloadClickWeishi.downloadId);
		if (a) {
			WeixinJSBridge.invoke("queryDownloadTask", {
				download_id : a
			}, function(b) {
				downloadClickWeishi.downloadStateChange(b)
			})
		}
	},
	downloadStateChange : function(a) {
		if (a && a.state) {
			if (!a.download_id || a.download_id == Q.getData(downloadClickWeishi.downloadId)) {
				if (a.state == "download_succ") {
					downloadClickWeishi.downloadComplete()
				}
				if (a.state == "default") {
					downloadClickWeishi.showDefaultState()
				}
				if (a.state == "downloading") {
					downloadClickWeishi.showDownloading()
				}
				if (a.state == "download_fail") {
					downloadClickWeishi.clearTask()
				}
			}
		}
	},
	clickHandler : function(b) {
		var a = b.target;
		if (a.tagName.toLowerCase() != "a") {
			a = Q.parent(a, function(d) {
				return (d.tagName.toLowerCase() == "a") ? true : false
			})
		}
		if (Q.hasClass(a, "client_weishi_new_downloading")) {
			downloadClickWeishi.stopDownload(a)
		} else {
			if (Q.hasClass(a, "client_weishi_new_tips")) {
				downloadClickWeishi.startDownload(a)
			} else {
				if (Q.hasClass(a, "client_weishi_new_install")) {
					downloadClickWeishi.installDownload(a)
				}
			}
		}
	},
	startDownload : function(b) {
		var a = b.href;
		if ( typeof WeixinJSBridge != "undefined" && WeixinJSBridge.invoke) {
			WeixinJSBridge.invoke("addDownloadTask", {
				task_name : downloadClickWeishi.taskName,
				task_url : a,
				file_md5 : downloadWeishiMD5
			}, function(d) {
				var g = d.err_msg;
				if (g.indexOf("add_download_task:ok") > -1) {
					var f = d.download_id;
					Q.setData(downloadClickWeishi.downloadId, f);
					downloadClickWeishi.showDownloading();
					openAppController.sendBoss("startDownLoadWeishi")
				} else {
					downloader.isPreventDefault = false
				}
			})
		} else {
			downloader.isPreventDefault = false
		}
	},
	showDefaultState : function() {
		var b = document.getElementById("imgdownload");
		if (b && b.getAttribute("app") == "weishi") {
			downloadClickWeishi.clearStyle(b);
			Q.addClass(b, "client_weishi_new_tips");
			var a = b.querySelector("span.down-text");
			if (a) {
				a.innerHTML = "下载腾讯微视客户端"
			}
		}
	},
	showDownloading : function() {
		var b = document.getElementById("imgdownload");
		if (b && b.getAttribute("app") == "weishi") {
			downloadClickWeishi.clearStyle(b);
			Q.addClass(b, "client_weishi_new_downloading");
			var a = b.querySelector("span.down-text");
			if (a) {
				a.innerHTML = "正下载腾讯微视客户端"
			}
		}
	},
	clearTask : function() {
		if (window.localStorage && localStorage.removeItem) {
			try {
				window.localStorage.clear()
			} catch(a) {
				window.localStorage.clear()
			}
		}
	},
	downloadComplete : function() {
		var b = document.getElementById("imgdownload");
		if (b && b.getAttribute("app") == "weishi") {
			downloadClickWeishi.clearStyle(b);
			Q.addClass(b, "client_weishi_new_install");
			var a = b.querySelector("span.down-text");
			if (a) {
				a.innerHTML = '<span class="down-text1">下载已完成，</span><span class="down-text2">直接打开微视</span>'
			}
			openAppController.sendBoss("succDownLoadWeishi")
		}
	},
	stopDownload : function(a) {
		var b = Q.getData(downloadClickWeishi.downloadId);
		if (b && typeof WeixinJSBridge != "undefined" && WeixinJSBridge.invoke) {
			WeixinJSBridge.invoke("cancelDownloadTask", {
				download_id : b,
				file_md5 : downloadWeishiMD5
			}, function(f) {
				var g = f.err_msg;
				if (g.indexOf("cancel_download_task:ok") > -1) {
					downloadClickWeishi.clearStyle(a);
					Q.addClass(a, "client_weishi_new_tips");
					var d = el.querySelector("span.down-text");
					if (d) {
						d.innerHTML = "下载腾讯微视客户端"
					}
					openAppController.sendBoss("stopDownLoadWeishi")
				} else {
					downloader.isPreventDefault = false
				}
			})
		} else {
			downloader.isPreventDefault = false
		}
	},
	clearStyle : function(a) {
		Q.removeClass(a, "client_new_install");
		Q.removeClass(a, "client_new_downloading");
		Q.removeClass(a, "client_new_tips");
		Q.removeClass(a, "client_weishi_new_install");
		Q.removeClass(a, "client_weishi_new_downloading");
		Q.removeClass(a, "client_weishi_new_tips")
	},
	installDownload : function(a) {
		var b = Q.getData(downloadClickWeishi.downloadId);
		if (b && typeof WeixinJSBridge != "undefined" && WeixinJSBridge.invoke) {
			WeixinJSBridge.invoke("installDownloadTask", {
				download_id : b,
				file_md5 : downloadWeishiMD5
			}, function(d) {
				var f = d.err_msg;
				if (f.indexOf("install_download_task:ok") > -1) {
					var g = setInterval(function() {
						if (true) {
							clearInterval(g)
						}
						openAppController.checkIsInstall()
					}, 500);
					openAppController.sendBoss("installNewsAppWeishi")
				} else {
					downloader.isPreventDefault = false
				}
			})
		} else {
			downloader.isPreventDefault = false
		}
	}
};
showMoreNews.init();
if ( typeof WeixinJSBridge != "undefined" && WeixinJSBridge.invoke) {
	weChatBridgeReady.init()
} else {
	document.addEventListener("WeixinJSBridgeReady", weChatBridgeReady.init)
}
var downloadInit = {
	Called : false,
	newsDownloadId : "downloadNews",
	videoDownloadId : "downloadVideo",
	newsDownloadName : null,
	videoDownloadName : null,
	newsDownloadValue : undefined,
	videoDownloadValue : undefined,
	mmuin : null,
	init : function() {
		var a = document.location.href;
		downloadInit.mmuin = downloadInit.getQuery(a, "mmuin") || downloadInit.getQuery(a, "openid");
		downloadInit.newsDownloadName = downloadInit.newsDownloadId + "_" + downloadInit.mmuin;
		downloadInit.videoDownloadName = downloadInit.videoDownloadId + "_" + downloadInit.mmuin;
		var b = downloadInit.newsDownloadName + "," + downloadInit.videoDownloadName;
		var f = navigator.userAgent.toLowerCase();
		var d = /android/i.test(f) ? true : false;
		if (d) {
			if (!Q.getData(downloadInit.newsDownloadName) && a.indexOf("isShare=1") == -1) {
				Q.remoteGetData(b, downloadInit.setIdFromCloud)
			} else {
				downloadInit.Called = true;
				downloadInit.newsDownloadValue = Q.getData(downloadInit.newsDownloadName);
				downloadInit.videoDownloadValue = Q.getData(downloadInit.videoDownloadName);
				openAppController.initStart()
			}
			downloadInit.recheck(downloadInit.newsDownloadName, downloadInit.videoDownloadName)
		} else {
			openAppController.initStart()
		}
	},
	setIdFromCloud : function(a) {
		if (downloadInit.Called) {
			return
		}
		if (a.ret != undefined && a.ret != 0) {
			return
		}
		downloadInit.newsDownloadValue = a.data[downloadInit.newsDownloadName];
		downloadInit.videoDownloadValue = a.data[downloadInit.videoDownloadName];
		if (downloadInit.newsDownloadValue) {
			Q.setData(downloadInit.newsDownloadName, downloadInit.newsDownloadValue);
			Q.setData(downloadInit.videoDownloadName, downloadInit.videoDownloadValue)
		}
		downloadInit.Called = true;
		openAppController.initStart()
	},
	recheck : function(b, a) {
		setTimeout(function() {
			if (downloadInit.Called) {
				return
			}
			var d = {
				data : {
					name1 : "",
					name2 : ""
				}
			};
			d.data[b] = Q.getData(b);
			d.data[a] = Q.getData(a);
			downloadInit.setIdFromCloud(d)
		}, 3000)
	},
	getQuery : function(b, d) {
		var f = new RegExp("(^|&|\\?|#)" + d + "=([^&#]*)(&|$|#)", "");
		var a = b.match(f);
		if (a) {
			return a[2]
		}
		return ""
	},
};
downloadInit.init();
/*  |xGv00|f17ffb24015b453fe777fd3569f0e5b0 */